﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace _2DGame
{
    class gameover
    {
        Texture2D _GOavslutaspeltxt, _GOhighscoretxt, _GOovertillmenytxt, _GOspelaigentxt, _GObakgrundtxt;
        Vector2 _GOavslutaspelpos, _GOhighscorepos, _GOovertillmenypos, _GOspelaigenpos, _GObakgrundpos;
        

        /// <summary>
        /// Makes the game over pictures
        /// </summary>
        /// <param name="GOavslutaspeltxt">avsluta spelet texture </param>
        /// <param name="GOavslutaspelpos">avsluta spelet position</param>
        /// <param name="GOhighscoretxt">etc</param>
        /// <param name="GOhighscorepos">etc</param>
        /// <param name="GOovertillmenytxt"></param>
        /// <param name="GOovertillmenypos"></param>
        /// <param name="GOspelaigentxt"></param>
        /// <param name="GOspelaigenpos"></param>
        /// <param name="GObakgrundtxt"></param>
        /// <param name="GObakgrundpos"></param>
        public gameover(Texture2D GOovertillmenytxt, Vector2 GOovertillmenypos, Texture2D GOspelaigentxt, Vector2 GOspelaigenpos, Texture2D GOhighscoretxt, Vector2 GOhighscorepos, Texture2D GOavslutaspeltxt, Vector2 GOavslutaspelpos, Texture2D GObakgrundtxt, Vector2 GObakgrundpos)
        {

            _GOavslutaspeltxt = GOavslutaspeltxt;
            _GOavslutaspelpos = GOavslutaspelpos;
            _GOhighscoretxt = GOhighscoretxt;
            _GOhighscorepos = GOhighscorepos;
            _GOovertillmenytxt = GOovertillmenytxt;
            _GOovertillmenypos = GOovertillmenypos;
            _GOspelaigentxt = GOspelaigentxt;
            _GOspelaigenpos = GOspelaigenpos;
            _GObakgrundtxt = GObakgrundtxt;
            _GObakgrundpos = GObakgrundpos;
            

       }
        /// <summary>
        /// Drawing the game over meny with spritebatch
        /// </summary>
        /// <param name="spriteBatch"></param>
        public void draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();

            spriteBatch.Draw(_GObakgrundtxt, _GObakgrundpos, Color.White);
            spriteBatch.Draw(_GOovertillmenytxt, _GOovertillmenypos, Color.White);
            spriteBatch.Draw(_GOspelaigentxt, _GOspelaigenpos, Color.White);
            spriteBatch.Draw(_GOhighscoretxt, _GOhighscorepos, Color.White);
            spriteBatch.Draw(_GOavslutaspeltxt, _GOavslutaspelpos, Color.White);

            spriteBatch.End();

        }
        public bool GameEnd(SpriteBatch spriteBatch) //method to quit game
        {
            if (Mouse.GetState().X > _GOavslutaspelpos.X && Mouse.GetState().X < _GOavslutaspelpos.X + _GOavslutaspeltxt.Width)
            {
                if (Mouse.GetState().Y > _GOavslutaspelpos.Y && Mouse.GetState().Y < _GOavslutaspelpos.Y + _GOavslutaspeltxt.Height)
                {
                    if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                    {

                        return true;
                    }
                    return false;
                }

                return false;
            }
            return false;
        }

        public bool OverTillMeny(SpriteBatch spriteBatch) //method to return to Main menu.
        {
            if (Mouse.GetState().X > _GOovertillmenypos.X && Mouse.GetState().X < _GOovertillmenypos.X + _GOovertillmenytxt.Width)
            {
                if (Mouse.GetState().Y > _GOovertillmenypos.Y && Mouse.GetState().Y < _GOovertillmenypos.Y + _GOovertillmenytxt.Height)
                {
                    if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                    {
                        return true;
                    }
                    return false;
                }
                return false;
            }
            return false;
        }
        public bool laddaUpp(SpriteBatch spriteBatch)
        {
            if (Mouse.GetState().X > _GOhighscorepos.X && Mouse.GetState().X < _GOhighscorepos.X + _GOhighscoretxt.Width)
            {
                if (Mouse.GetState().Y > _GOhighscorepos.Y && Mouse.GetState().Y < _GOhighscorepos.Y + _GOhighscoretxt.Height)
                {
                    if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                    {
                        return true;
                    }
                    return false;

                }
                return false;
            }
            return false;

        }
        public bool spelaIgen(SpriteBatch spriteBatch)
        {
            if (Mouse.GetState().X > _GOspelaigenpos.X && Mouse.GetState().X < _GOspelaigenpos.X + _GOspelaigentxt.Width)
            {
                if (Mouse.GetState().Y > _GOspelaigenpos.Y && Mouse.GetState().Y < _GOspelaigenpos.Y + _GOspelaigentxt.Height)
                {
                    if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                    {
                        return true;
                    }
                    return false;
                }
                return false;
            }
            return false;
        }
    }

}
